local juedou = fk.CreateSkill {
  name = "lingling__juedou",
}

Fk:loadTranslationTable {
  ["lingling__juedou"] = "角斗",
  [":lingling__juedou"] = "你可以将两张牌当【杀】使用，若目标与你手牌数相同则无法抵消。",

  ["#lingling__juedou"] = "角斗：你可以将两张牌当【杀】使用",
}

juedou:addEffect("viewas", {
  pattern = "slash",
  prompt = "#lingling__juedou",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected < 2
  end,
  view_as = function(self, player, cards)
    if #cards ~= 2 then return end
    local card = Fk:cloneCard("slash")
    card.skillName = juedou.name
    card:addSubcards(cards)
    return card
  end,
})

juedou:addEffect(fk.PreCardEffect, {
  can_refresh = function(self, event, target, player, data)
    return data.from and data.from == player and table.contains(data.card.skillNames, juedou.name) and
      data.to:getHandcardNum() == player:getHandcardNum()
  end,
  on_refresh = function(self, event, target, player, data)
    data.unoffsetable = true
  end,
})

juedou:addAI(nil, "vs_skill")

return juedou
